<template>
	<view class="payMent">
		<view class="img">
			<image src="/static/home/paySuccess.png"></image>
		</view>
		<view>支付成功</view>
		<view class="money">
			<text>实付金额：</text>
			<text class="tow">￥{{exam_price}}</text>
		</view>
		<!-- <view class="footer" @tap="getIndex">返回首页</view> -->
		<view class="footer" @tap="getExamination">去模拟</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loadingImg: '',
				image: '',
				pay: false,
				exam_price: '',
				exam_duration: '',
				course_id: '',
				order_sn: ''
			}
		},
		onLoad(option) {
			this.exam_price = option.price
			this.order_sn = option.order_sn
			this.exam_duration = option.exam_duration
			this.course_id = option.course_id
			// this.$forceUpdate();
		},
		onShow() {
			
		},
		onBackPress(options) {
			if (options.from === 'navigateBack') {
				return false;
			}
			this.back();
			return true;
		},
		methods: {
			changePay(k) {
				this.pay = !this.pay
			},
			// 去模拟考试
			getExamination() {
				uni.navigateTo({
					url: '/pages/home/home/examination?course_id=' + this.course_id + '&exam_duration=' + this.exam_duration + '&type=' + 2 + '&order_sn=' + this.order_sn
				})
			},
			getIndex() {
				uni.switchTab({
					url: '/pages/home/home/home'
				})
			},
			back() {
				uni.navigateBack({
					delta: 3
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.payMent {
		text-align: center;
		.img {
			width: 140rpx;
			height: 140rpx;
			margin: 140rpx auto 40rpx;
			image {
				height: 140rpx;
				width: 140rpx;
			}
		}
		.money {
			margin-top: 40rpx;
			font-size: 28rpx;
			margin-bottom: 96rpx;
			.tow {
				color: #FF4C46;
			}
		}
		.footer {
			// position: fixed;
			// bottom: 64rpx;
			margin:  0 auto;
			width: 360rpx;
			height: 88rpx;
			background: #267DFF;
			opacity: 1;
			border-radius: 48rpx;
			// margin-left: 32rpx;
			color: #FFFFFF;
			line-height: 88rpx;
			text-align: center;
		}
	}
</style>
